<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>阻止默认行为</title>
</head>
<body>
<div id="app">
    <!--.prevent 事件修饰符用来阻止元素的默认行为-->
    <a href="https://www.baidu.com" v-on:click.prevent="hrefClicked">有问题，百度一下</a>
</div>

<script type="module">
    import {createApp} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                function hrefClicked() {
                    console.log("点击了 超链接");
                }

                return {
                    hrefClicked,
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>